home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1997 / HAM Radio 1997.iso / vcls / wsanet8a / wsanet / src / ini.h < prev    next >
C/C++ Source or Header  |  1996-04-08  |  4KB  |  183 lines

  1. /* INI.H - Ini Control header file */
  2.  
  3.     // Resource ID's for the button BMP's
  4. #define IDBMP_INI        9000
  5. #define IDBMP_INIDOWN    9001
  6. #define IDBMP_INIMONO    9003
  7. #define IDBMP_INIEGA     9006
  8.  
  9.     // Sizes for static strings
  10. #define MAX_SECTION_SIZE  80
  11. #define MAX_ENTRY_SIZE    80
  12. #define MAX_DEFAULT_SIZE  256
  13. #define MAX_FILENAME_SIZE 144
  14. #define MAX_VALUE_SIZE    256
  15.  
  16.     // Default values
  17. #define DEFAULT_FILENAME  "win.ini"
  18.  
  19.     // All of the property indicies
  20. // Enumerations of Properties in Ini_Properties[]
  21. // MUST BE IN SAME ORDER
  22. enum enum_INI_props
  23. {
  24.     /* Standard properties */
  25.  IPROP_INI_CTLNAME,
  26.  IPROP_INI_PARENT,
  27.  IPROP_INI_INDEX,
  28.  IPROP_INI_TOP,
  29.  IPROP_INI_LEFT,
  30.  IPROP_INI_TAG,
  31.  IPROP_INI_SECTION,
  32.  IPROP_INI_ENTRY,
  33.  IPROP_INI_DEFAULT,
  34.  IPROP_INI_VALUE,
  35.  IPROP_INI_FILENAME
  36. };
  37.  
  38. // Errors sent back to VB (and .RC identifiers)
  39. #define ERR_None                0
  40.  
  41.     // Returnable Errors within VB
  42. #define ERR_OUTOFMEMORY         7
  43.  
  44.     // Ini's Control structure
  45. typedef struct tagINI
  46. {
  47.  MOLE mSection;
  48.  MOLE mEntry;
  49.  MOLE mDefault;
  50.  MOLE mFilename;
  51. } INI;
  52.  
  53. typedef INI FAR * LPINI;
  54.  
  55.  
  56. #ifdef WSANet_C
  57.  
  58.     // Section property
  59. // This is the value [Section] in an .INI file
  60. PROPINFO iniProperty_Section =
  61. {
  62.  "Section",
  63.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  64.  0,
  65.  0, 0, NULL, 0
  66. };
  67.  
  68.     // Entry property
  69. // This is the value Entry= in an .INI file
  70. PROPINFO iniProperty_Entry =
  71. {
  72.  "Entry",
  73.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  74.  0,
  75.  0, 0, NULL, 0
  76. };
  77.  
  78.     // Default property
  79. // This sets the default value for Value if no such
  80. // Entry= in [Section] in Filename.ini is found.
  81. PROPINFO iniProperty_Default =
  82. {
  83.  "Default",
  84.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  85.  0,
  86.  0, 0, NULL, 0
  87. };
  88.  
  89.     // Value property
  90. // This is the Value of the Entry= in [Section] in Filename.ini
  91. PROPINFO iniProperty_Value =
  92. {
  93.  "Value",
  94.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  95.  0,
  96.  0, 0, NULL, 0
  97. };
  98.  
  99.     // Filename property
  100. // This should hold the filename of the .INI file.
  101. PROPINFO iniProperty_Filename =
  102. {
  103.  "Filename",
  104.  DT_HSZ | PF_fGetMsg | PF_fSetMsg | PF_fNoInitDef,
  105.  0,
  106.  0, 0, NULL, 0
  107. };
  108.  
  109.     // The Ini control's property information structure
  110. PPROPINFO Ini_Properties[] =
  111. {
  112.  PPROPINFO_STD_CTLNAME,
  113.  PPROPINFO_STD_PARENT,
  114.  PPROPINFO_STD_INDEX,
  115.  PPROPINFO_STD_TOP,
  116.  PPROPINFO_STD_LEFT,
  117.  PPROPINFO_STD_TAG,
  118.  &iniProperty_Section,
  119.  &iniProperty_Entry,
  120.  &iniProperty_Default,
  121.  &iniProperty_Value,
  122.  &iniProperty_Filename,
  123.  NULL
  124. };
  125.  
  126. PEVENTINFO Ini_Events[] =
  127. {
  128.  NULL
  129. };
  130.  
  131. MODEL modelIni =
  132. {
  133.  VB100_VERSION,
  134.  MODEL_fDesInteract | MODEL_fLoadMsg,
  135.  (PCTLPROC)IniCtlProc,
  136.  CS_VREDRAW | CS_HREDRAW,
  137.  WS_CHILD | WS_VISIBLE,
  138.  sizeof(INI),
  139.  IDBMP_INI,
  140.  "Ini",
  141.  "Ini",
  142.  NULL,
  143.  Ini_Properties,
  144.  Ini_Events,
  145.  IPROP_INI_VALUE,
  146.  0,
  147.      // VB2.0+ specific
  148.  IPROP_INI_VALUE,
  149.      // VB3.0+ specific
  150.  INI_VERSION
  151. };
  152.  
  153. #endif /* WSANet_C */
  154.  
  155. #define MODELLIST_INI (LPMODEL)&modelIni
  156.  
  157. #ifdef WSANet_C
  158.  
  159.     // All of the help "context-id's" are referenced through
  160.     // this table
  161. static WORD wIniHelpProps[] =
  162. {
  163.  PROPERTY_NAME,
  164.  PROPERTY_PARENT,
  165.  PROPERTY_INDEX,
  166.  PROPERTY_TOP,
  167.  PROPERTY_LEFT,
  168.  PROPERTY_TAG,
  169.  INI_PROP_SECTION,
  170.  INI_PROP_ENTRY,
  171.  INI_PROP_DEFAULT,
  172.  INI_PROP_VALUE,
  173.  INI_PROP_FILENAME,
  174.  NULL
  175. };
  176.  
  177. #endif /* WSANet_C */
  178.  
  179.     // Function Prototypes
  180. VOID iniRebuildStrings(HCTL, LPINI);
  181.  
  182. /* End of Ini.H */
  183.